<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>

<?php
$attributes = array(
    'class' => 'control-label',
);
?>
<div class="span9">

    <?php echo get_message(); ?>
    <h2><?php echo $titulo; ?></h2>

    <h3>Buscar Por:</h3>

    <?php echo form_open(); ?>

    <div class="row-fluid">
        <div class="span2">
            <div class="control-group">
                <?php echo form_label('Matrícula', 'matricula', $attributes); ?>
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'matricula', 'type' => 'text')); ?>
                </div>
            </div>
        </div>
        <div class="span2">
            <div class="control-group">
                <?php echo form_label('Documento', 'numeroDoc', $attributes); ?>
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'numeroDoc', 'type' => 'text')); ?>
                </div>
            </div>
        </div>
        <div class="span2">
            <div class="control-group">
                <?php echo form_label('Nombre', 'nombre', $attributes); ?>
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'nombre', 'type' => 'text')); ?>
                </div>
            </div>
        </div>
        <div class="span2">
            <div class="clearfix" style="height: 25px;"></div>
            <div class="control-group">
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'submit', 'type' => 'submit', 'value' => 'Buscar', 'class' => 'btn')); ?>
                </div>
            </div>
        </div>
    </div>

    <?php echo form_close(); ?>

    <div class="clearfix"></div>

    <div class="container-table">
        <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-hover table-bordered" id="example">
            <thead>
                <tr>
                    <th>Matrícula</th>
                    <th>Apellido y Nombre</th>
                    <th>Tipo de Doc</th>
                    <th>Nro de Doc</th>
                    <th>Teléfono</th>
                    <th>Dirección</th>
                    <th>Localidad</th>
                    <th>Acciones</th>
                </tr>
            </thead>
            <tbody>
                <?php
                if (!empty($medicos)) {
                    $color = 'odd';
                    foreach ($medicos as $medico) {
                        $color = ( $color == 'odd') ? 'even' : 'odd';
                        ?>
                        <tr class="<?php echo $color; ?>">
                            <td><?php echo $medico->matricula; ?></td>
                            <td><?php echo $medico->nombre; ?></td>
                            <td><?php echo $tipoDoc[$medico->tipoDoc]; ?></td>
                            <td><?php echo $medico->numeroDoc; ?></td>
                            <td><?php echo $medico->telefono; ?></td>
                            <td><?php echo $medico->direccion; ?></td>
                            <td><?php echo $medico->localidad; ?></td>
                            <td>
                                <a class="btn btn-small" href="<?php echo base_url('medicos/editar/' . $medico->matricula); ?>"><span class="icon-pencil"></span> Editar</a>
                               <!-- <a class="btn btn-small eliminar" href="#eliminar" role="button" data-toggle="modal" dbid="<?php echo $medico->matricula; ?>"><span class="icon-remove"></span> Eliminar</a>  -->
                            </td>
                        </tr>
                        <?php
                    }
                }
                ?>
            </tbody>
        </table>
    </div>
</div>

<?php echo form_hidden('url', ''); ?>